<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui" xmlns:a4j="http://richfaces.org/a4j">

<h:body>
	<h:form>
		<p:panel header="Select the hotel you want to insert">
			<h:panelGrid columns="2" id="regGrid">
				<h:dataTable value="#{PersonalizationBean.hotels}" var="item">
					<h:column>#{item}</h:column>
				</h:dataTable>
				<br />
				<h:outputLabel for="id">hotel ID:</h:outputLabel>
				<p:inputText id="id" value="#{PersonalizationBean.hotelID}" />
				<p:message for="id" />
				<p:commandButton value="Select" update="regGrid"
					action="#{PersonalizationBean.saveHotel()}" />

				<br />
				<br />
			</h:panelGrid>


			<h5>type the id Attraction in the box then press add</h5>
			<h:form id="aa">
				<h5>Attractions of your packet</h5>
				<h:dataTable value="#{PersonalizationBean.packetAttractions}"
					var="item">
					<h:column>#{item}</h:column>
				</h:dataTable>

				<h5>Attractions available</h5>
				<h:dataTable value="#{PersonalizationBean.cityAttractions}"
					var="item">
					<h:column>#{item}</h:column>
				</h:dataTable>
				<p:panel header="insert">
					<h:panelGrid columns="3" id="regGrid1">


						<h:outputLabel for="Id3">attraction #</h:outputLabel>
						<p:inputText id="Id3"
							value="#{PersonalizationBean.addAttractionID}" />
						<p:message for="Id3" />
						<p:commandButton value="Add" update="aa" id="ajax1"
							actionListener="#{PersonalizationBean.addAttraction()}" />

					</h:panelGrid>
				</p:panel>
				<p:panel header="insert">
					<h:panelGrid columns="3" id="regGrid2">


						<h:outputLabel for="Id2">attraction #</h:outputLabel>
						<p:inputText id="Id2"
							value="#{PersonalizationBean.removeAttractionID}" />
						<p:message for="Id2" />
						<p:commandButton value="Remove" update="regGrid2" id="ajax"
							actionListener="#{PersonalizationBean.removeAttraction()}" />

					</h:panelGrid>
				</p:panel>

			</h:form>


			<h:form id="abc">
				<h5>Departure flights list:</h5>
				<h:dataTable value="#{PersonalizationBean.departureFlights}"
					var="item">
					<h:column>#{item}</h:column>
				</h:dataTable>

				<h5>Return flights list</h5>
				<h:dataTable value="#{PersonalizationBean.returnFlights}" var="item">
					<h:column>#{item}</h:column>
				</h:dataTable>
			</h:form>
			
			<p:panel header="insert the flight IDs">
			<h:panelGrid columns="3" id="regGrid11">
				<h:outputLabel for="Id4">departure</h:outputLabel>
				<p:inputText id="Id4" value="#{PersonalizationBean.departureFlight}" />
				<p:message for="Id4" />

				<h:outputLabel for="Id5">return</h:outputLabel>
				<p:inputText id="Id5" value="#{PersonalizationBean.returnFlight}" />
				<p:message for="Id5" />
				<p:commandButton value="Select" update="regGrid11"
					actionListener="#{PersonalizationBean.changeFlights()}" />

			</h:panelGrid>
		</p:panel>
		
		
		<p:panel header="Set Dates" id="form">
			<h:panelGrid columns="3" id="regGrid10">
	
			<h:outputLabel for="departure">departure:</h:outputLabel>
			<p:inputMask id="departure" value="#{PersonalizationBean.departure}"
				mask="99/99/9999">
				<f:convertDateTime pattern="dd/MM/yyyy" />
			</p:inputMask>
			<p:message for="departure" />

			<h:outputLabel for="return">return:</h:outputLabel>
			<p:inputMask id="return" value="#{PersonalizationBean.return_}"
				mask="99/99/9999">
				<f:convertDateTime pattern="dd/MM/yyyy" />
			</p:inputMask>
			<p:message for="return" />
			

			</h:panelGrid>
			<p:commandButton value="Set Dates" update="regGrid10" actionListener="#{PersonalizationBean.setDates()}"/>
			</p:panel>
	
	<h:outputLabel for="partecipants"># of partecipants:</h:outputLabel>
			<p:inputText id="partecipants" value="#{PersonalizationBean.partecipants}" />
			<p:message for="partecipants" />
	
		<p:panel header="CONFIRM PACKET" id="formb">
			<h4> If you confirm your packet you won't be able to modify it any further </h4>
			<p:commandButton value="CONFIRM" actionListener="#{PersonalizationBean.confirm()}"/>
			
			</p:panel>
	
	
		</p:panel>

		


		<h:link outcome="/user/index" value="HomePage" />
		<br />

	</h:form>
</h:body>
</html>